<?php
/* @var $this BlockController */
/* @var $model Block */

$this->breadcrumbs=array(
	'Blocks'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Block', 'url'=>array('index')),
	array('label'=>'Create Block', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('block-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>



<div class="search-form">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'block-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'zbl_id',
		//'zm_id',
		'zbl_title',
		'zbl_pos',		
		array('name'=>'zbl_type','value'=>'Block::model()->getType($data->zbl_type)'),
		array('name'=>'zna_id','value'=>'Nav::model()->getTitle($data->zna_id)'),
		/*'zbl_data',
		
		'zbl_template',
		'zna_id',
		'inputtime',
		'updatetime',
		*/
		array(
			'class'=>'CButtonColumn',
			'header' => '操作',  
			'template'=>'{update} {delete}',			
			'updateButtonImageUrl' => '/images/edit.png',
			'updateButtonLabel' => '修改',
			'updateButtonOptions' => array('title'=>'修改'),  
			'deleteButtonImageUrl' => '/images/del.png', 
		),
	),
)); ?>
